# schemas/sys_table_mapping.py
from pydantic import BaseModel
from typing import Optional


class SysTableMappingBase(BaseModel):
    api_id: Optional[str] = None
    mapping_code: Optional[str] = None
    mapping_name: Optional[str] = None
    mapping_description: Optional[str] = None
    table_name: Optional[str] = None
    deletion_mark: Optional[int] = 0
    deletion_reason: Optional[str] = None
    deletion_date: Optional[str] = None
    deletion_by: Optional[str] = None
    creator_by: Optional[str] = None
    last_updated_by: Optional[str] = None


class SysTableMappingCreate(SysTableMappingBase):
    pass


class SysTableMappingUpdate(SysTableMappingBase):
    pass


class SysTableMapping(SysTableMappingBase):
    id: str
    create_date: str
    last_updated_date: Optional[str] = None

    class Config:
        from_attributes = True
